<%@ page language="java" import="java.util.*,com.beans.*,com.enums.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %> 
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML>
<html>
<head>
<base href="<%=basePath%>">

<title></title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">    

<script type="text/javascript" src="js/jquery-1.8.0.js"></script> 
	<script type="text/javascript">
		$(function(){
			$("#ch_checkall,#top_ch_checkall").click(function(){
				if(this.checked){
					$("input[name=ck_id]").attr("checked","checked");
				}else{
					$("input[name=ck_id]").removeAttr("checked");
				}		
			});
					
			$("table tr").mouseover(function(){
				$(this).css("background","#D3EAEF");
				$(this).siblings().css("background","white");
			});
		});
	</script>

	<link rel="stylesheet" type="text/css" href="css/maintable.css" ></link>

</head>
	<script >

	</script>

<body>

				<div class ="div_title">
						<div class="div_titlename"> <img src="images/san_jiao.gif" ><span>管理人员基本信息列表</span></div>
						<div class="div_titleoper">
							<input type="checkbox" id="top_ch_checkall"/> 全选 <a href="admin_add.jsp"> <img src="images/add.gif"/>添加 </a> <a href="javascript:void(0)"><img src="images/del.gif"/>删除</a> </div>
				 </div>
				 
				 <form action="AdminServlet.do?flog=showAdmin"  name="form1" method="post">
				
				 <table class="main_table" >
				       <tr>
				 				<th><input type="checkbox" id="ch_checkall" /></th>	<th>账号</th> 	<th>状态</th>	<th>备注</th>  <th>最后更新日期</th> 	<th>操作</th>
				 		</tr>
				 		
				 		<c:forEach var="item" items="${adminList }">
					 		<tr>
					 				<td>
					 					<input type="checkbox" name="ck_id" value="69" /> 
					 				</td>
					 				<td>${item.adminName}</td>	
					 				<td>
					 					<c:if test="${item.state=='2'}">
					 						锁定
					 					</c:if>
					 						
					 				</td>	
					 				<td> <a title="${item.note}">
					 					<c:if test="${item.note.length()>7}">
					 						${item.note.substring(0,7)}...
					 					</c:if>
	 									<c:if test="${item.note.length()<=7}">
					 						${item.note}
					 					</c:if>
					 				</a> </td>	
					 				
					 				<td>${item.editDate}</td>	
					 				<td>	
					 					<c:if test="${item.state=='2'}">
					 						<a href="AdminServlet.do?flog=nolock&id=${item.id}" onclick="return confirm('确认解除锁定？')">解除锁定</a> |  	
						 			    	<a href="AdminServlet.do?flog=del&id=${item.id}" onclick="return confirm('确认删除？')">删除</a> 
					 					</c:if>
					 					<c:if test="${item.state!='2'}">
						 					<a href="AdminServlet.do?flog=lock&id=${item.id}" onclick="return confirm('确认锁定？')">锁定</a> |  
						 					<a href="AdminServlet.do?flog=goChangeAdmin&id=${item.id}">修改</a> |  	
						 			    	<a href="AdminServlet.do?flog=del&id=${item.id}" onclick="return confirm('确认删除？')">删除</a> 
										</c:if>
					 				</td>
					 		</tr>
				 		</c:forEach>
				</table>
				
				
				<div class="div_page" >
					  <div class="div_page_left">    共有 <label>${page.rowCount}</label> 条记录，当前第 <label>${page.pageIndex }</label> 页，共 <label>${page.pageCount }</label> 页	</div>		
					  <div class="div_page_right" > 	 
					  			<c:choose>
									<c:when test="${page.hasPre }">
										<a href="AdminServlet.do?flog=showAdmin&pageIndex=1">首页</a>
										<a href="AdminServlet.do?flog=showAdmin&pageIndex=${page.pageIndex-1 }">上一页</a>
									</c:when>
									
									<c:otherwise>
							        		首页
							        		前一页
							        </c:otherwise>
								</c:choose>
								
								<c:choose>
									<c:when test="${page.hasNext }">
										<a href="AdminServlet.do?flog=showAdmin&pageIndex=${page.pageCount }">尾页</a>
										<a href="AdminServlet.do?flog=showAdmin&pageIndex=${page.pageIndex+1 }">下一页</a>
									</c:when>
									
									<c:otherwise>
							        		尾页
							        		下一页
							        </c:otherwise>
								</c:choose>

					  	  <input type="submit" value="转到"/>
					  	 <input type="text" name="pageIndex" id="pageIndex" value="${page.pageIndex }" /> 页
					  	
					   </div>
				</div>
				
				</form>

  </body>
</html>	
